package com.cn.wxwinnie.file;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 潇湘暮雨 E-mail:wxwinnie@hotmail.com
 * 
 * @version 创建时间：2014年3月24日 下午9:03:42
 * 
 */
public class MyFileRead_ReadByte {

	public static void main(String[] args) throws IOException {
		File f = new File("d:/FileRead.txt");
		InputStream is = new FileInputStream(f);
		FileInputStream fis = new FileInputStream(f);
		FileReader fr = new FileReader(f);
		BufferedReader br = new BufferedReader(fr);

		List<Byte> temp = new ArrayList<Byte>();
		byte[] b = new byte[10];
		byte[] temps = new byte[is.available()];
		while (-1 != is.read(b)) {
			for (int i = 0; i < b.length; i++) {
				if (b[i] != 0) {
					//temps[temps.length] = b[i];
					b[i] = 0;
				}
			}
		}
		
		System.out.println();
		System.out.println(new String(temps, "utf-8"));
		System.out.println("temp.size() : " + temp.size());

	}

}
